<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDeviceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('device', function (Blueprint $table) {
            $table->increments('id');
            $table->string('model')->nullable()->comment('机型,如iPhone 6S');
            $table->string('devToken')->nullable()->comment('推送Token,仅限iOS设备');
            $table->string('width')->nullable()->comment('屏幕宽度');
            $table->string('height')->nullable()->comment('屏幕高度');
            $table->string('countryCode')->nullable()->comment('国家代码');
            $table->string('language')->nullable()->comment('系统语言');
            $table->string('uuid')->comment('UUID');
            $table->string('idfa')->comment('IDFA');
            $table->string('osName')->nullable()->comment('操作系统,比如iOS');
            $table->string('osVersion')->nullable()->comment('操作系统版本,比如:10.3.1');
            $table->string('appName')->nullable()->comment('APP名称');
            $table->string('appId')->nullable()->comment('APPid');
            $table->string('channelId')->nullable()->comment('渠道号');
            $table->string('subChannelId')->nullable()->comment('子渠道号');
            $table->string('version')->nullable()->comment('app版本');
            $table->string('versionCode')->nullable()->comment('int,app版本code');
            $table->string('packageName')->nullable()->comment('包名');
            $table->integer('createdAt')->comment('创建时间');
            $table->integer('updatedAt')->comment('最后更新时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('device');
    }
}
